import axios from '../../request'
export default {
    namespaced: true,

    state:{
        serveitems:[],
        sonlist:{},
    
        imglist:[
            {   
                id:1,
                img:"https://lanhu-dds-backend.oss-cn-beijing.aliyuncs.com/merge_image/imgs/426739aca63346b4a3ce6985cfde7a8a_mergeImage.png"
            },
            {
                id:2,
                img:"https://lanhu-dds-backend.oss-cn-beijing.aliyuncs.com/merge_image/imgs/5b95166bc08e400f9fa3088d5a0944f2_mergeImage.png",
            },
            {
                id:3,
                img:"https://lanhu-dds-backend.oss-cn-beijing.aliyuncs.com/merge_image/imgs/68c1d39c631e49caa5b15d8007daf277_mergeImage.png",
            },
            {
                id:4,
                img:"https://lanhu-dds-backend.oss-cn-beijing.aliyuncs.com/merge_image/imgs/5b95166bc08e400f9fa3088d5a0944f2_mergeImage.png",
            },
            {
                id:5,
                img:"https://lanhu.oss-cn-beijing.aliyuncs.com/SketchPng5bfa693abede7b85cbd8a1b29baa1209b72f84926dc8348bc33676c1e43298f5",
            },
            {
                id:6,
                img:"",
            },
            {
                id:7,
                img:"https://lanhu-dds-backend.oss-cn-beijing.aliyuncs.com/merge_image/imgs/c0f86ca4e4034b29ae384f3939a22a2d_mergeImage.png",
            }

        ]
    },
    getters: {
        
    },
    mutations: {
        getlist(state,{res}){
            state.serveitems = res.data.data;
        },
        getserve(state,{res}){
            state.sonlist = res.data.data;
            console.log(state.sonlist)
        }
    },
    actions: {
        servetype(context,id){
            axios.get("/api/sys/myService",{
                params:{
                    id,
                }
            }).then( res => context.commit("getlist",{res}))
        },
        sonserve(context,id){
            axios.get("/api/sys/myService/serve",{
                params:{
                    id,
                }
            }).then( res => context.commit("getserve",{res}))
        }

    }
}